/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面过渡动画 */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
    overflow-x: hidden;
    background: linear-gradient(to bottom, #e6f2ff, #b3d9ff);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #333;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 头部样式 */
header {
    background-color: rgba(230, 242, 255, 0.9);
    padding: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(179, 217, 255, 0.3);
    z-index: 1000;
}

nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

nav li {
    margin: 0 1rem;
    display: flex;
    align-items: center;
}

nav a {
    font-weight: bold;
    color: #1a3d66;
    display: flex;
    align-items: center;
    height: 100%;
}

nav a:hover {
    color: #0d2440;
}

/* 主题切换按钮样式 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-selector {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 0.3rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.language-selector:focus {
    outline: none;
    border-color: #b3d9ff;
}

/* 深色模式样式 */
body.dark-mode {
    background: linear-gradient(to bottom, #0c1e3a, #1a3d66);
    color: #f0f0f0;
}

body.dark-mode a {
    color: #f0f0f0;
}

body.dark-mode header {
    background-color: rgba(12, 30, 58, 0.9);
    border-bottom: 1px solid rgba(179, 217, 255, 0.1);
}

body.dark-mode nav a {
    color: #b3d9ff;
}

body.dark-mode nav a:hover {
    color: #e6f2ff;
}

body.dark-mode h2 {
    border-bottom: 2px solid #f0f0f0;
}

body.dark-mode .social-link {
    background-color: rgba(12, 30, 58, 0.5);
}

body.dark-mode .social-link:hover {
    background-color: rgba(26, 61, 102, 0.7);
}

body.dark-mode .theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

body.dark-mode .theme-icon::before {
    content: "☀️";
}

/* 主要内容样式 */
main {
    margin-top: 80px;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* 关于模块样式 */
.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.intro, .experience, .achievements {
    margin-bottom: 2rem;
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill-category h4 {
    margin-bottom: 0.5rem;
    color: #555;
}

.skill-category ul {
    list-style-type: disc;
    padding-left: 1.2rem;
}

.skill-category li {
    margin-bottom: 0.3rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: -29px;
    bottom: 0;
    width: 4px;
    background-color: #333;
    left: 40%;
    margin-left: 1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
}

.timeline-item::after {
    content: "";
    display: table;
    clear: both;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    width: 40%;
    padding-right: 2rem;
    text-align: right;
    font-weight: bold;
    float: left;
}

.timeline-content {
    width: 60%;
    float: right;
    padding-left: 2rem;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 3px solid #333;
    background-color: white;
    border-radius: 50%;
    top: 0;
    left: -6px;
}

.timeline-content h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.certificates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.certificate {
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.certificate-date {
    font-style: italic;
    color: #666;
    margin-bottom: 0.5rem;
}

/* 作品集样式 */
.portfolio-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portfolio-item {
    border: 1px solid #ddd;
    padding: 1rem;
    text-align: center;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

/* 联系表单样式 */
#contact-form {
    max-width: 600px;
    margin: 2rem auto;
}

#contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 3px;
}

#contact-form button {
    background-color: #333;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

#contact-form button:hover {
    background-color: #555;
}

/* 联系模块样式 */
.contact-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info h3,
.contact-map h3 {
    margin-bottom: 1rem;
    color: #1a3d66;
}

.social-media {
    margin-top: 2rem;
}

.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: rgba(230, 242, 255, 0.5);
    border-radius: 5px;
    text-align: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: rgba(179, 217, 255, 0.7);
    transform: translateY(-3px);
}

.social-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.social-name {
    font-weight: bold;
}

/* 底部样式 */
footer {
    background-color: #f4f4f4;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav li {
        margin: 0.5rem 0;
    }
    
    main {
        margin-top: 150px;
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .skills {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-date {
        width: 100%;
        padding-right: 0;
        text-align: left;
        padding-left: 60px;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content {
        width: 100%;
        padding-left: 60px;
    }
    
    .certificates {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* 针对小屏幕设备的额外优化 */
@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }
    
    nav li {
        margin: 0.25rem 0;
    }
    
    main {
        margin-top: 130px;
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    .portfolio-items {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        grid-template-columns: 1fr;
    }
}
